<HTML xmlns:og="http://ogp.me/ns#" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<TITLE>大连理工大学</TITLE>	

</HEAD>
<BODY>
	<div class="row" layout:fragment="content">
		<div class="col-md-8 col-md-offset-2">
			<div>
				<h2>仿真结果</h2>
			</div>
			<div>
			<iframe width="1000" height="650" allow="fullscreen" src="https://cloud.anylogic.com/assets/embed?modelId=58055e80-2c73-432f-8e47-07f1c7a7389b"></iframe>
			</div>
			<DIV class="table-responsive">
			<TABLE class="table dataTable">		
				<thead>
					<tr>
					<th>序号</th>
					<th>numqc</th>
					<th>numit</th>
					<th>qqct1</th>
					<th>qqct2</th>
					<th>bst</th></tr>
				</thead>					
				<TBODY id="tb1">
					<tr>
					<td>1</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>2</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>3</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>4</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>5</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>6</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>7</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>8</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>9</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
					
					<tr>
					<td>10</td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td>
					<td><input type="number"></input></td></tr>
				</TBODY>
			</TABLE>
			</DIV>
			<SCRIPT  th:inline="javascript">
		//tip是提示信息，type:'success'是成功信息，'danger'是失败信息,'info'是普通信息,'warning'是警告信息
		function showTip(tip, type) {
		    var $tip = $('#tip');
		    $tip.stop(true).prop('class', 'alert alert-' + type).text(tip).fadeIn(500).delay(1000).fadeOut(500);
		}
		function save()
		{
			var sno=$("#sno").val();
			var sname=$("#sname").val();
			if(sno==""||sname=="")
				{
				showTip("请输入学号和姓名信息！","warning");
				return;
				}
			var rdata={};
			rdata.sno=sno;
			rdata.sname=sname;
			rdata.list=[];
			
			var trList = $("#tb1").children("tr");  
			 /* <![CDATA[ */
		    for (var i=0;i<trList.length;i++) {  
		    	var map={};
		       map.numqc=trList.eq(i).find("td").eq(1).find("input").val();
		       map.numit=trList.eq(i).find("td").eq(2).find("input").val();
		       map.qqc1=trList.eq(i).find("td").eq(3).find("input").val();
		       map.qqc2=trList.eq(i).find("td").eq(4).find("input").val();
		       map.bst = trList.eq(i).find("td").eq(5).find("input").val();
		     //   console.log(map);
		       rdata.list.push(map);
		    } 
		    /* ]]> */
		    console.log(rdata);
			$.ajax({
				type : "POST",
				url :  "saveResult2.json",
				data :  JSON.stringify(rdata),
				contentType : "application/json",
				dataType : "json",
	            success:function(data) {
	            	if(data.res==1){
	            		showTip(data.msg,"success");	
	            		$("#results").show();//显示查看所有结果的按钮
	            	}
	            		
	            	else
	            		showTip(data.msg,"danger");
				}
			});
		}
		</SCRIPT>
		<div align="center"> <button data-toggle="modal" data-target="#myModal" class="btn btn-success" type="button">保存结果</button></div>
		<div style="float:right;width:40%;height:40px">
					<div id="tip" style="display: none;z-index: 9999;width:100%;text-align:center;padding:10px;margin-bottom:2px;"></div>
				</div>
		
		</div>
		<!-- 模态框开始 -->
<div class="modal fade" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="background-color:transparent;width:100%;max-height:100%;">
  <div class="modal-dialog" >
    <div class="modal-content" style="width:100%;height:100%">
 
   <!--    模态框头部 -->
      <div class="modal-header">
        <h2 class="modal-title">输入个人信息</h2>
      </div>
 
     <!--  模态框主体 -->
      <div class="modal-body">
          <input type="text" name="sno" id="sno" class="form-control" placeholder="请输入学号"></input>
          <input type="text" name="sname" id="sname" class="form-control" placeholder="请输入姓名"></input>
      </div>
 
      <!-- 模态框底部 -->
      <div class="modal-footer">
        <button type="button" class="btn btn-success" data-dismiss="modal" onClick="javascript:save()">提交</button>
        <button type="button" class="btn btn-warning" data-dismiss="modal">关闭</button>
      </div>
 
    </div>
  </div>
</div> 
<!-- 模态框结束 -->	
	</div>	
	
</BODY>
</HTML>